docs: fix the doc shooting for the volume button
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Thu, 13 Feb 2014 09:01:41 +0000 (04:01 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 14 Feb 2014 01:47:25 +0000 (20:47 -0500)
docs/tools/widgets.c

index 2db4bbfdee49cde45826e4f7ea5522197212a8b3..3b9d3398bb519af6cd0b2bb137d7fdf21b18a836 100644 (file)
@@ -1079,15 +1079,25 @@ create_spinner (void)
 static WidgetInfo *
 create_volume_button (void)
 {
-  GtkWidget *button, *widget;
-  GtkWidget *plus_button;
+  GtkWidget *button, *box;
+  GtkWidget *widget;
+  GtkWidget *popup;
+
+  widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+  gtk_widget_set_size_request (widget, 100, 250);
+
+  box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
+  gtk_container_add (GTK_CONTAINER (widget), box);
 
   button = gtk_volume_button_new ();
+  gtk_box_pack_end (GTK_BOX (box), button, FALSE, FALSE, 0);
+
   gtk_scale_button_set_value (GTK_SCALE_BUTTON (button), 33);
-  /* Hack: get the private dock */
-  plus_button = gtk_scale_button_get_plus_button (GTK_SCALE_BUTTON (button));
-  widget = gtk_widget_get_parent (gtk_widget_get_parent (gtk_widget_get_parent (plus_button)));
-  gtk_widget_show_all (widget);
+  popup = gtk_scale_button_get_popup (GTK_SCALE_BUTTON (button));
+  gtk_widget_realize (widget);
+  gtk_widget_show (box);
+  gtk_widget_show (popup);
+
   return new_widget_info ("volumebutton", widget, ASIS);
 }